package cn.qiyu5522.tk_ems.entity.dto;

import cn.qiyu5522.tk_ems.convert.LocalDateTimeConverter;
import cn.qiyu5522.tk_ems.convert.SexConverter;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @BelongsProject: tk_ems
 * @BelongsPackage: cn.qiyu5522.tk_ems.entity.dto
 * @Author: TangQi
 * @CreateTime: 2023-02-09  15:47
 * @Description: TODO
 * @Version: 1.0
 */
@Data
// 默认不管加不加ExcelProperty的注解的所有字段都会参与读写，加了ExcelIgnoreUnannotated注解以后，不加ExcelProperty注解的字段就不会参与
@ExcelIgnoreUnannotated
public class StudentExcelDTO {
    @ExcelProperty(value = "学号",index = 1)
    private Long id;
    @ExcelProperty(value = "名称",index = 2)
    private String name;
    @ExcelProperty(value = "年龄",index = 3)
    private Integer age;
    @ExcelProperty(value = "性别(1:男0:女)",converter = SexConverter.class,index = 4)
    private Integer gender;
    @ExcelProperty(value = "联系电话",index = 5)
    private String phone;
    private Long classroomId;
    @ExcelProperty(value = "所在班级",index = 6)
    private String classroom;
    @ExcelProperty(value = "所属专业",index = 7)
    private String major;
    private Long majorId;
    @ExcelProperty(value = "所属院系",index = 8)
    private String department;
    private Long departmentId;
    @ExcelProperty(value = "创建时间",converter = LocalDateTimeConverter.class,index = 9)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ExcelProperty(value = "更新时间",converter = LocalDateTimeConverter.class,index = 10)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
